fix(scan): resolve favicon href against origin to stop pathful-target misfetch#350
Conversation
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #350 +/- ##
=======================================
Coverage ? 54.76%
=======================================
Files ? 81
Lines ? 6871
Branches ? 0
=======================================
Hits ? 3763
Misses ? 2839
Partials ? 269 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
pr summary2 files changed (+35 -14)
|
32ffe17 to
da12973
Compare
vmfunc
left a comment
There was a problem hiding this comment.
swapping the prefix ladder for ResolveReference is the right call, and routing the /favicon.ico probe (favicon.go:136) through it too is what actually kills the /app/favicon.ico misfetch, not just the declared-link case. base always carries a scheme post-normalize so the parse-error fallbacks are dead but harmless. anchoring tests cover all five branches. in.
a root-relative href was being appended to the target url's existing path instead of resolved against the origin, so a target like https://example.com/app would fetch /app/favicon.ico instead of /favicon.ico. resolveFaviconURL now delegates to net/url's ResolveReference, matching how a browser actually resolves root-relative, scheme-relative and absolute icon hrefs.